//
//  DoctorDetailTableViewCell.m
//  QuickCure1
//
//  Created by summer的Dad on 16/11/1.
//  Copyright © 2016年 maoge. All rights reserved.
//

#import "DoctorDetailTableViewCell.h"
@interface DoctorDetailTableViewCell ()
//头像
@property(nonatomic,weak)UIImageView* iv_imageView;
//名字
@property(nonatomic,weak)UILabel * leb_title;
//副标题
@property(nonatomic,weak)UILabel * leb_disease;
//时间
@property(nonatomic,weak)UILabel * leb_time;
//预约
@property(nonatomic,weak)UILabel * leb_appointment;
@end

@implementation DoctorDetailTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self setupUI];
    }
    return self;
    
    
}
- (void)setupUI
{
    //lebelTile
    UILabel* lebTitle = [[UILabel alloc] init];
    lebTitle.text = @"王大夫";
    lebTitle.font = [UIFont boldSystemFontOfSize:15];

    lebTitle.textColor = [UIColor blackColor];
    [self.contentView addSubview:lebTitle];
    _leb_title = lebTitle;
    //约束
    [lebTitle mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.leading.equalTo(self.contentView).offset(10);
        make.height.offset(20);
       
    }];
   
//    //leble
    UILabel* leb_disease = [[UILabel alloc] init];
    leb_disease.text = @"主任医师";
     leb_disease.font = [UIFont boldSystemFontOfSize:15];
    [self.contentView addSubview:leb_disease];
    _leb_disease = leb_disease;
    
    [leb_disease mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(lebTitle.mas_centerY);
        
        make.leading.equalTo(lebTitle.mas_trailing).offset(8);
    }];
    
//    //lebleTime
    UILabel* leb_time = [[UILabel alloc] init];
    leb_time.textColor = [UIColor blackColor];
    
    _leb_time = leb_time;
    [self setTime];
    leb_time.font = [UIFont boldSystemFontOfSize:15];
    [self.contentView addSubview:leb_time];
    [leb_time mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(lebTitle.mas_bottom).offset(10);
        make.leading.equalTo(self.contentView).offset(8);
        make.height.offset(20);
        make.bottom.equalTo(self.mas_bottom).offset(-10);
        
    }];
    
    self.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;
    UIButton* btn = [UIButton buttonWithType:0];
    [btn setBackgroundImage:[UIImage imageNamed:@"tabbar_mainframe"] forState:UIControlStateNormal];
    [btn setBackgroundImage:[UIImage imageNamed:@"tabbar_mainframeHL"] forState:UIControlStateHighlighted];
    [btn sizeToFit];
    
    self.accessoryView = btn;
    
    
}

-(void)setModel:(DoctorApplyListModel *)model
{
    _model = model;
    self.leb_title.text = model.doctor_name;
//    NSLog(@"%@",model);
    
}
#pragma mark
#pragma mark - 设置时间
- (void)setTime
{
    
    //获取当前时间日期
    NSDate *date=[NSDate date];
    NSDateFormatter *format1=[[NSDateFormatter alloc] init];
    
    //拿到时间数据
    
    [format1 setDateFormat:@"就诊时间:yyyy-MM-dd"];
    //拿到时间数据
    NSString *dateStr;
    dateStr=[format1 stringFromDate:date];
    
    self.leb_time.text = dateStr;
    
    
}

- (void)awakeFromNib {
    [super awakeFromNib];

}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}



@end
